﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Web;

namespace Orion.MyLib
{
	public class TextFileLogMedia : LogMedia
	{
		public override void LogMessage(string message)
		{
			string strLogFile = ConfigurationManager.AppSettings["LogFile"];
            string strLogFolder = ConfigurationManager.AppSettings["LogFolder"];

            if (!Directory.Exists(strLogFolder))
            {
                Directory.CreateDirectory(strLogFolder);
            }

			using (StreamWriter writer = new StreamWriter(strLogFile, true))
			{
				writer.WriteLine(message);
			}
		}
	}
}